//
//  SelectedGoodNewHeaderDataModel1.m
//  TryShopping
//
//  Created by panquanReabam.com on 16/12/29.
//  Copyright © 2016年 RuiBen. All rights reserved.
//

#import "SelectedGoodNewHeaderDataModel1.h"

@implementation SelectedGoodNewHeaderDataModel1
+(instancetype)dataModelWithDict:(NSDictionary *)dict
{
    SelectedGoodNewHeaderDataModel1 *dataModel=[[self alloc] init];
    dataModel.imageUrlFull=dict[@"imageUrlFull"];
    dataModel.itemCode=dict[@"itemCode"];
    dataModel.itemId=dict[@"itemId"];
    dataModel.itemName=dict[@"itemName"];
    dataModel.itemType=dict[@"itemType"];
    dataModel.maxPrice=dict[@"maxPrice"];
    dataModel.minPrice=dict[@"minPrice"];
    dataModel.salePrice=dict[@"salePrice"];
    dataModel.invQty=dict[@"invQty"];
    dataModel.specType=dict[@"specType"];
    dataModel.itemType=dict[@"itemType"];
    dataModel.memberPrice=dict[@"memberPrice"];
    dataModel.specName=dict[@"specName"];
    dataModel.specId=dict[@"specId"];
    dataModel.dealPrice=dict[@"dealPrice"];
    dataModel.planStatus=dict[@"planStatus"];
    
    dataModel.suitItemQty=dict[@"suitItemQty"];
    dataModel.headImageFull=dict[@"headImageFull"];
    return dataModel;
}
-(void)setSpecCount:(NSString *)specCount
{
    _specCount=specCount?specCount:0;
}
-(float)getWeiboHight{
    float height = 0;
    if(![[NSString stringWithFormat:@"%@",self.combiMainId]isEqualToString:@""]&&[[NSString stringWithFormat:@"%@",  self.planType]isEqualToString:@"P003"]) {
        
        height=0;
        if (self.plans.count>1) {
            height=20;
        }
    }else{
        
        
        if ([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buyMember"]&&self.plans.count>0  ) {
            
            
            if (self.plans.count>1) {
                height=40;
                
            }else{
                
            }
            
        }else  if ([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buySpecial"]&&self.plans.count>0  ) {
            
            
            if (self.plans.count>1) {
                height=40;
                
            }else{
                
            }
            
            
        }else
            if ([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buyGive"]&&self.plans.count>0  ) {
                
                
                if (self.plans.count>1) {
                    
                    height=40+self.items.count*90;
                    
                }else{
                    height=self.items.count*90;
                    
                }
                
                
            }else if([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buyDown"]&&self.plans.count>0) {
                
                if (self.plans.count>1) {
                    height=40+self.items.count*90;
                    
                }else{
                    height=self.items.count*90;
                    
                }
                
            }
            else if([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buyDiscount"]&&self.plans.count>0) {
                
                if (self.plans.count>1) {
                    height=40+self.items.count*90;
                    
                }else{
                    height=self.items.count*90;
                    
                }
                
            }
            else if([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buyAddPrice"]&&self.plans.count>0) {
                
                if (self.plans.count>1) {
                    height=40+self.items.count*90;
                    
                }else{
                    height=self.items.count*90;
                    
                }
                
            }
            else if([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buySecond"]&&self.plans.count>0) {
                
                if (self.plans.count>1) {
                    height=40;
                    
                }else{
                    
                }
                
            }
            else if([[NSString stringWithFormat:@"%@",  self.spType]isEqualToString:@"buySuit"]&&self.plans.count>0) {
                
                if (self.plans.count>0) {
                    
                    
                    height=self.items.count*100;
                    
                    if (self.plans.count>1) {
                        
                        height=40+height;
                        if ([[NSString stringWithFormat:@"%@",  self.productType]isEqualToString:@"Suit"]) {
                            
                            height=height+30;
                        }
                        
                    }else{
                        if ([[NSString stringWithFormat:@"%@",  self.productType]isEqualToString:@"Suit"]) {
                            
                            height=height+30;
                        }
                        
                    }
                    
                    
                    
                }else{
                    height=self.items.count*90;
                    
                }
                
            }else{
                
                
                if (self.plans.count>1) {
                    
                    height=20;
                }else{
                    height=-20;
                    
                }
            }
    }
    
    
    return height;
}
@end
